<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>注册</title>
<style>
  /* login.html 中的样式 */
  body {
    font-family: 'Open Sans', Arial, sans-serif;
    background-color: #f4f8fb;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 0;
  }
  form {
    background-color: #ffffff;
    padding: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
  }

  h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
  }

  input[type="text"],
  input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    margin-bottom: 20px;
  }

  input[type="text"]:focus,
  input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  }

  button {
    background-color: #007bff;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s;
  }

  button:hover {
    background-color: #0056b3;
  }
  
  a.register-link {
    display: inline-block;
    margin-top: 20px;
    color: #007bff;
    text-decoration: none;
    padding-left: 140px;
  }
  a.register-link:hover {
    text-decoration: underline;
  }

  @media (max-width: 768px) {
    form {
      width: 90%;
      padding: 20px;
    }
  }
  .flashes {
  list-style-type: none;
  padding: 0;
}

.flashes li {
  color: red; /* 或者您选择的任何颜色 */
  text-align: center;
}

  /* ... 响应式设计样式保持不变 ... */
</style>
</head>
<body>
  {% with messages = get_flashed_messages() %}
  {% if messages %}
    <ul class="flashes">
    {% for message in messages %}
      <li>{{ message }}</li>
    {% endfor %}
    </ul>
  {% endif %}
{% endwith %}
<form method="POST" action="{{ url_for('register') }}">
  <h2>注册</h2>
  <div class="form-group">
    <label for="username">用户名:</label>
    <input type="text" id="username" name="username" required>
  </div>
  <div class="form-group">
    <label for="password">密码:</label>
    <input type="password" id="password" name="password" required>
</div>
<button type="submit">注册</button>
<a href="{{ url_for('login') }}" class="register-link">登录</a>
</form>
